<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var p = new Promise(function (resolve, reject) {
        setTimeout(function () {
            var t = false
            if (t) {
                resolve('正确执行的函数')
            } else {
                reject('失败执行的函数')
            }
        }, 1500)

    })
    p.then(function (msg) {
        console.log('then的第一个函数')
        console.log(msg)
    }, function (info) {
        console.log('then的第二个函数')
        console.log(info)
    })
</script>

</html>